package com.utcs.common.persistence;

import java.io.Serializable;

/**
 * Created by Fly on 2017/5/23.
 */
public abstract class BaseEntity<T>  implements Serializable{

    private static final long serialVersionUID = 1L;

    /**
     * id 唯一主键 自增
     */
    protected Integer id;

    public BaseEntity() {
    }

    public BaseEntity(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 插入之前执行方法，子类实现
     */
    public abstract void preInsert();

    /**
     * 更新之前执行方法，子类实现
     */
    public abstract void preUpdate();
}
